package userFriend

import (
    "gitee.com/zwx784533/zwx2018/app"
    "gitee.com/zwx784533/zwx2018/model/userFriend"
)

func AddFriend(c *app.Context)  {
    type postData struct {
        FUid int `json:"f_uid"`
        Mark string `json:"mark"`
    }
    var data postData
    err := c.GetRawData(&data)
    if err != nil {
        c.ErrorResponse(400, err.Error())
        return
    }

    uid := c.Uid
    err = userFriend.AddFriend(uid, data.FUid, 0, data.Mark)
    if err != nil {
        c.ErrorResponse(400, err.Error())
        return
    }
    c.ResponseJson(0, app.Obj{})
    return
}
